{% extends "base.html" %}
{% block content %}

            <div id="top-stories">
                <h3>Articles by category: {{ category }}</h3>
                {% for article in articles %}
                {% if article.imagelink %}<div class="article-image" >{% if article.titleurlpath %}<a href="/articles/{{ article.titleurlpath }}">{% else %}<a href="/article?key={{ article.key }}">{% endif %}<img class="small-image" src="{{ article.imagelink }}" /></a></div>{% endif %}


                <h3 class="article-title">{% if article.titleurlpath %}<a href="/articles/{{ article.titleurlpath }}">{% else %}<a href="/article?key={{ article.key }}">{% endif %}{{ article.title }}</a></h3>
                <div class="article-date">{{ article.date|date:"D, F d Y" }} - by {{ article.authornickname }}</div>
                <div class="article-category">{% for category in article.categories %}
                {{ category }}{% if not forloop.last %}, {% endif %}
                {% endfor %}</div>
                <!--{% if article.imagelink %}
                <img src="{{ article.imagelink }}">
                {% endif %}-->
                <p class="article-content">{{ article.summary }} <span class="article-commentcount"><a href="/articletopics?article={{ article.key }}">Discuss</a></span></p>
                {% endfor %}
                <div id="pagination">
                    {% if prevpage %}
                        <span id="prev"><a href="/articlecategory?category={{category}}&page={{ prevpage }}">< Prev Page</a></span>
                    {% endif %}
                    {% if nextpage %}
                        <span id="next"><a href="/articlecategory?category={{category}}&page={{ nextpage }}"> Next Page ></a></span>
                    {% endif %}
                </div>
            </div>
{% endblock %}